1. Field of the Invention
The present invention relates to a barcode recognition method, and more particularly to a barcode recognition method for linear or stacked barcode.
2. Related Art
A linear barcode contains black and white bar blocks arranged at intervals. On the basis of an assigned barcode protocol, a width of each bar block and an arrangement of black and white combination of bar blocks represent different numbers and letters. The number and letter combination represented by the aforementioned width and black and white combination of bar blocks are different according to the barcode protocols.
Currently, there are two common methods for recognizing the barcode. In the first method, entire image containing the barcode is captured, and complex numerical operation is performed on the captured image through complex image processing method to find out an area containing the barcode in the captured image. However, the method of processing the entire image consumes much hardware resources. To a handheld data processing device with relatively low hardware performance, this method requires considerable operation time.
The second method is mainly directed to a linear barcode. A scan track is defined in the captured image through all the bar blocks of the barcode, the image is processed and binarization process is performed only on the scan track, and the barcode is decoded after a binary array is generated. In this method, only one scan track is processed, therefore the barcode recognition rate is very fast. However, one single scan track may contain a portion that cannot be binarized due to poor sampling quality, so the recognition result of the barcode cannot pass the checksum verification. Particularly for a long barcode, for example, a barcode containing multiple segments, there is an increased probability that the recognition result cannot pass the checksum verification due to recognition errors of a single barcode data character. As long as a recognition error occurs with regard to any barcode data character or a certain bar cannot be imaged clearly, the recognition result cannot pass the checksum verification, so this recognition result is directly abandoned and next scanning and recognizing procedure has to be performed. If the barcode has an undesirable quality, the scanning and recognizing procedure are repeated additional times, requiring considerable additional scanning and recognition time.